
#ifndef __graphicsH__
#define __graphicsH__

#include "screen.h"
#include "wtftypes.h"
#include "vector.h"
#include "dator.h"

#ifdef _WIN32
#	include <windows.h>
#endif

#include <GL/gl.h>
#include <GL/glu.h>

namespace WtfGraphics {

	/**
	 * General Graphics Mode
	 **/
	struct GraphicsMode
	{
		typedef enum {
			RESIZABLE = 1, FIXED = 2, FULLSCREEN = 3, BORDERLESS = 4
		} tWindowStyle;

		bool		bHwAccel;
		tWindowStyle WindowStyle;
		iVector2D	Resolution;
		unsigned	uBitsPerPixel;
		unsigned	uNumBuffers;

		/// Implementation-specific - sets up a default graphics mode
		GraphicsMode();

		inline bool operator ==(const GraphicsMode& g) const {
			return bHwAccel == g.bHwAccel && WindowStyle == g.WindowStyle && 
				Resolution == g.Resolution && uBitsPerPixel == g.uBitsPerPixel && uNumBuffers == g.uNumBuffers;
		};
	};

	typedef WtfEngine::Setting<GraphicsMode> tGraphicsMode;

	/**
	 * Generic screen interface
	 * Defines methods to be implemented by the Screen class.
	 **/
	IMPL_INTERFACE(Screen): public virtual WtfEngine::IScreen {
		IMPL_DECL_NOSTUB( void SetMode(const GraphicsMode&) );
		IMPL_DECL_NOSTUB( void GetMode(GraphicsMode&) );
	};

	void InitScripting();
};

#if defined(_WIN32) && defined(AVOID_SDL)
#	include "graphics_win32.h"
#else
	// Only supports SDL at the moment
#	include "graphics_sdl.h"
#endif

#endif // __graphicsH__
